/* Copyright (c) 2025 Beijing Semidrive Technology Corporation
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/** *****************************************************************************************************
 *  \file     Mcu_Soc.h                                                                                 *
 *  \brief    This file contains interface header for MCU MCAL driver, ...                              *
 *                                                                                                      *
 * <table>                                                                                              *
 * <tr><th>Date           <th>Version                                                                   *
 * <tr><td>2023/08/03     <td>1.0.0                                                                     *
 * </table>                                                                                             *
 *******************************************************************************************************/

#ifndef MCU_SOC_H
#define MCU_SOC_H


#ifdef __cplusplus
extern "C" {
#endif
/********************************************************************************************************
 *                                      Include header files                                            *
 *******************************************************************************************************/
#include "Std_Types.h"
#include "Mcal.h"
#include "Mcu_Cfg.h"
/********************************************************************************************************
 *                                 Global Macro definition                                              *
 *******************************************************************************************************/
/* Version and Check Begin */
/* Version Info Begin */
#define MCU_SOC_H_VENDOR_ID    0x8C
#define MCU_SOC_H_AR_RELEASE_MAJOR_VERSION    4
#define MCU_SOC_H_AR_RELEASE_MINOR_VERSION    3
#define MCU_SOC_H_AR_RELEASE_REVISION_VERSION 1
#define MCU_SOC_H_SW_MAJOR_VERSION    1
#define MCU_SOC_H_SW_MINOR_VERSION    0
#define MCU_SOC_H_SW_PATCH_VERSION    0
/* Version Info End */

/********************************************************************************************************
 *                                  Global Types definition                                             *
 *******************************************************************************************************/
typedef enum
{
    /* 0-3 for CR52 */
    MCU_CPU_INDEX_0 = 0U,
    MCU_CPU_INDEX_1,
    MCU_CPU_INDEX_2,
    MCU_CPU_INDEX_3,
    MCU_CPU_INDEX_MAX
    /*PRQA S 1535 1*/
} Mcu_CoreType;
/********************************************************************************************************
 *                                  Global Function Declarations                                        *
 *******************************************************************************************************/
/** *****************************************************************************************************
 * \brief To get cpu identify index .
 *
 * \verbatim
 * Syntax             : uint8 Mcu_GetCoreID(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : coreId
 *
 * Description        : To get cpu identify index .
 * \endverbatim
 *******************************************************************************************************/
uint8 Mcu_GetCoreID(void);

/** *****************************************************************************************************
 * \brief get the mian frequency of each core.
 *
 * \verbatim
 * Syntax             : uint32 Mcu_Ip_SocGetCoreFreq(void)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Reentrant
 *
 * Parameters (in)    : None
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : core main frequency, 0xFFFFFFFF means error.
 *
 * Description        : get the main frequency of each core.
 * \endverbatim
 *******************************************************************************************************/
uint32 Mcu_Ip_SocGetCoreFreq(void);

/** *****************************************************************************************************
 * \brief mapped address convert to TCM physical address.
 *
 * \verbatim
 * Syntax             : uint32 soc_to_dma_address(uint32 cpuAddr)
 *
 * Service ID[hex]    : None
 *
 * Sync/Async         : Synchronous
 *
 * Reentrancy         : Non reentrant
 *
 * Parameters (in)    : mapped address
 *
 * Parameters (inout) : None
 *
 * Parameters (out)   : None
 *
 * Return value       : TCM physical address
 *
 * Description        : mapped address convert to TCM physical address.
 * \endverbatim
 *******************************************************************************************************/
uint32 soc_to_dma_address(uint32 cpuAddr);
#ifdef __cplusplus
}
#endif

#endif /* MCU_SOC_H */
